package com.xqx.controller;

import com.xqx.config.SpringConfiguration;
import com.xqx.service.UserService;
import com.xqx.service.impl.UserServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.stereotype.Controller;

/**
 * @author：xingquanxiang createTime：2019/10/2 14:29
 * description:
 */
@Controller
public class UserController {

    public static void main(String[] args) {
        // ClassPathXmlApplicationContext app = new ClassPathXmlApplicationContext("applicationContext.xml");
        AnnotationConfigApplicationContext app = new AnnotationConfigApplicationContext(SpringConfiguration.class);
        UserService userService = (UserService)app.getBean("userService");
        userService.save();
        app.close();
    }
}
